/**
 * 点，参数可选 
 * @author zhouzhanglin
 * @param x  默认为0
 * @param y 默认为0
 * @returns {Point}
 */
Point = function( x,y)
{
	this.x = x||0 ;
	this.y = y||0 ;
};
/**
 * 此点到圆点的距离
 * @returns
 */
Point.prototype.getLength = function()
{
	return Math.sqrt( this.x*this.x+this.y*this.y );
};
/**
 * 计算两个点之间距离
 * @param p1
 * @param p2
 * @returns
 */
Point.prototype.distance = function(p1 , p2 )
{
	var dx = p1.x - p2.x;
	var dy = p1.y - p2.y;
	return Math.sqrt(dx * dx + dy * dy);	
};
/**
 * 两个点的位置是否相同
 * @param p1
 * @param p2
 * @returns {Boolean}
 */
Point.prototype.equals = function (p1,p2)
{
	return p1.x==p2.x && p1.y==p2.y;
};
/**
 * 复制点
 * @returns {Point}
 */
Point.prototype.clone = function ()
{
	return new Point(this.x,this.y);
};
/**
 * 输出此点的信息
 */
Point.prototype.toString = function()
{
	return "(x=" + this.x + ", y=" + this.y + ")";	
};